# Maintainer: Dave Reisner <dreisner@archlinux.org>
# Maintainer: Andreas Radke <andyrtr@archlinux.org>

pkgname=ed
pkgver=1.17
pkgrel=1
pkgdesc="A POSIX-compliant line-oriented text editor"
arch=('x86_64')
license=('GPL')
url="https://www.gnu.org/software/ed/ed.html"
depends=('glibc' 'sh')
options=('!emptydirs')
validpgpkeys=('1D41C14B272A2219A739FA4F8FE99503132D7742')  # Antonio Diaz Diaz
source=("https://ftp.gnu.org/gnu/ed/$pkgname-$pkgver.tar.lz"{,.sig})
sha256sums=('71de39883c25b6fab44add80635382a10c9bf154515b94729f4a6529ddcc5e54'
            'SKIP')

build() {
  cd "$pkgname-$pkgver"

  ./configure --prefix=/ \
              --bindir=/usr/bin \
              --mandir=/usr/share/man \
              --infodir=/usr/share/info \
              "CPPFLAGS=$CPPFLAGS" \
              "CFLAGS=$CFLAGS" \
              "LDFLAGS=$LDFLAGS"

  make
}

check() {
  make -C "$pkgname-$pkgver" check
}

package() {
  make -C "$pkgname-$pkgver" "DESTDIR=$pkgdir" install
}
